package com.lsa.letcode.the143.reorderList;

import org.junit.Test;

import com.lsa.letcode.common.LetCodeTestBase;
import com.lsa.letcode.common.ListNode;

public class ReorderListTest extends LetCodeTestBase {
	@Test
	public void test() throws Exception {
		test(asList(1), asList(1));
		test(asList(1,2), asList(1,2));
		test(asList(1,3,2), asList(1,2,3));
		test(asList(1,4,2,3), asList(1,2,3,4));
		test(asList(1,5,2,4,3), asList(1,2,3,4,5));
		test(asList(1,6,2,5,3,4), asList(1,2,3,4,5,6));
		test(asList(1,7,2,6,3,5,4), asList(1,2,3,4,5,6,7));
	}

	private void test(ListNode expected, ListNode in) {
		Solution s = new Solution();
		s.reorderList(in);
		assertEqual(expected, in);
	} 
}
